package com.genexususa.eo.bing.test.add;

import com.genexususa.eo.bing.connection.AdExtensionManager;
import com.genexususa.eo.bing.test.TestUtil;

public class ConsumeAddAdExtensions {
    public static void main(String[] args) {
        TestUtil testUtil = new TestUtil();
        String adExtensionsXML =    "<Bing_AdExtensionCollection xmlns=\"L2TMediaDev\">\n" +
                                        "\t<CallAdExtensionCollection>\n" +
                                        "\t</CallAdExtensionCollection>\n" +
                                        "\t<LocationAdExtensionCollection>\n" +
                                        "\t</LocationAdExtensionCollection>\n" +
                                        "\t<ProductAdExtensionCollection>\n" +
                                        "\t</ProductAdExtensionCollection>\n" +
                                        "\t<SiteLinksAdExtensionCollection>\n" +
                                            "\t\t<SiteLinksAdExtension>\n" +
                                                "\t\t\t<GxCampaignId>545648987</GxCampaignId>\n" +
                                                "\t\t\t<GxSiteLinksAdExtensionId>561010961055</GxSiteLinksAdExtensionId>\n" +
                                                "\t\t\t<Status>Active</Status>\n" +
                                                "\t\t\t<Type>Tipo4</Type>\n" +
                                                "\t\t\t<Version>0</Version>\n" +
                                                "\t\t\t<SiteLinkCollection>\n" +
                                                    "\t\t\t\t<SiteLink>\n" +
                                                        "\t\t\t\t\t<DestinationUrl>www.hello.com</DestinationUrl>\n" +
                                                        "\t\t\t\t\t<DisplayText>www.display.com</DisplayText>\n" +
                                                    "\t\t\t\t</SiteLink>\n" +
                                                "\t\t\t</SiteLinkCollection>\n" +
                                            "\t\t</SiteLinksAdExtension>\n" +
                                            /*"\t\t<SiteLinksAdExtension>\n" +
                                                "\t\t\t<GxCampaignId>564678978</GxCampaignId>\n" +
                                                "\t\t\t<GxSiteLinksAdExtensionId>561010961056</GxSiteLinksAdExtensionId>\n" +
                                                "\t\t\t<Status>Active</Status>\n" +
                                                "\t\t\t<Type>Tipo5</Type>\n" +
                                                "\t\t\t<Version>0</Version>\n" +
                                                "\t\t\t<SiteLinkCollection>\n" +
                                                    "\t\t\t\t<SiteLink>\n" +
                                                        "\t\t\t\t\t<DestinationUrl>www.hola2.com</DestinationUrl>\n" +
                                                        "\t\t\t\t\t<DisplayText>www.display2.com</DisplayText>\n" +
                                                    "\t\t\t\t</SiteLink>\n" +
                                                "\t\t\t</SiteLinkCollection>\n" +
                                            "\t\t</SiteLinksAdExtension>\n" +*/
                                        "\t</SiteLinksAdExtensionCollection>\n" +
                                    "</Bing_AdExtensionCollection>\n";
        AdExtensionManager resource = new AdExtensionManager();
        System.out.println("Consuming AddAdExtensions.....");
        String userName = testUtil.userName;
        String password = testUtil.password;
        String developerToken = testUtil.developerToken;
        long customerId = testUtil.customerId;
        long customerAccountId = testUtil.customerAccountId;
        String applicationId = testUtil.applicationId;
        long accountId = testUtil.accountId1;
        //String result = resource.addAdExtensions(userName, password, developerToken, customerId, customerAccountId, applicationId, accountId, adExtensionsXML);
        String result = resource.addAdExtensions(customerAccountId, adExtensionsXML);
        System.out.println("Result:\n" + result);
    }
}
